package geticsen.markdown.render.element;

import geticsen.markdown.render.element.base.Paragraph;
import lombok.EqualsAndHashCode;
import lombok.Getter;

import java.util.List;

@Getter
@EqualsAndHashCode(callSuper = false)
public class NormalParagraph extends Paragraph {

    /**
     * 段落行
     */
    private final List<String> lines;

    public NormalParagraph(List<String> lines) {
        this.lines = lines;
        this.setElClass("md-normal-paragraph");
    }

    @Override
    public List<String> lineStrings() {
        return lines;
    }


    @Override
    public String toHtml() {
        String content = String.join("\n", lines);
        return String.format("<p class=\"%s\">%s</p>", elClass, content);
    }
}
